package com.example.demo.rabbitmq.provider;

import cn.hutool.json.JSONObject;
import com.example.demo.rabbitmq.MQSendUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("provider")
public class Provider1 {
    @Autowired
    private MQSendUtil mqSendUtil;

    @RequestMapping("test")
    public JSONObject jsonObject(){
        for (int i = 0; i <200 ; i++) {
            mqSendUtil.send("你好"+i,"quene1","qu.nihao","exchange");//路由写quna或者tuniu 都可以
            System.out.println("已发送"+i+"消息");
        }
        return null;
    }
}
